package com.onemile.controls;

import java.util.ArrayList;

import com.onemile.app.R;
import com.onemile.entity.model.EStandardListViewItem;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class AdpLV_Account extends BaseAdapter
{
   private ArrayList<EStandardListViewItem> mList;
   private LayoutInflater mInflater;
   
   public AdpLV_Account(ArrayList<EStandardListViewItem> list,Context context)
   {
	  mList=list;
	  mInflater=LayoutInflater.from(context);
   }

   @Override
   public int getCount()
   {
	  return mList.size();
   }

   @Override
   public Object getItem(int position)
   {
	  return mList.get(position);
   }

   @Override
   public long getItemId(int position)
   {
	  return 0;
   }

   @Override
   public View getView(int position, View convertView, ViewGroup parent)
   {
	 convertView=mInflater.inflate(R.layout.account_item, null);
	 ImageView img=(ImageView)convertView.findViewById(R.id.img_accout_item);
	 TextView txt=(TextView)convertView.findViewById(R.id.txt_account_item);
	 
	 img.setImageResource(mList.get(position).getImage());
	 txt.setText(mList.get(position).getText());
	 
	  return convertView;
   }
}
